<html><head><title>Apache Click v2.2.0 Cheat Sheet</title></head><body><div id='tit'>Apache Click v2.2.0 Cheat Sheet</div><div id='cate'>源码品读</div><div id='date'>2010年10月13日 星期三 01:58 P.M.</div><div id='page'>7</div><a id='url' href='http://hi.baidu.com/hxzon/blog/item/813af0035658b3783812bbeb.html'>http://hi.baidu.com/hxzon/blog/item/813af0035658b3783812bbeb.html</a><div id='cnt'><p>Apache Click&nbsp;&nbsp; v2.2.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cheat Sheet</p> 
<p><a href="http://click.apache.org/docs/click-cheat-sheet.pdf">http://click.apache.org/docs/click-cheat-sheet.pdf</a></p> 
<p>Page Processing <br /> ● no-args constructor used to create new Page<br /> ● context, format, headers and path dependencies set<br /> ● request parameter values bound to matching named fields<br /> ● onSecurityCheck() – called for security check<br /> ● onInit()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – called to complete initialization<br /> ● all the page controls are processed<br /> ● onGet/Post()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – called for additional processing<br /> ● onRender()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – called for pre-render processing<br /> ● page template and model is rendered<br /> ● onDestroy()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – called to clean up any resources</p> 
<p> <span><img class="blogimg" border="0" small="0" src="image/Apache Click v2.2.0 .ff31053b7cc3a1a214cecb0d.jpg" /><p class="origImg">http://hiphotos.baidu.com/hxzon/pic/item/ff31053b7cc3a1a214cecb0d.jpg</p><br /> </span></p> 
<p>Template Model Includes <br /> ● any public Page fields by field name<br /> ● context&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – the servlet context path<br /> ● headElements – the page Css and other head elements<br /> ● format&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – the Format object<br /> ● imports&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – the PageImports object<br /> ● jsElements&nbsp;&nbsp; – the page JavaScript elements<br /> ● messages&nbsp;&nbsp;&nbsp;&nbsp; – the MessagesMap object<br /> ● path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – the path of the Page template<br /> ● request&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – the HttpServletRequest object<br /> ● response&nbsp;&nbsp;&nbsp;&nbsp; – the HttpServletResponse object&nbsp;&nbsp;&nbsp;&nbsp;<br /> ● session&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – the SessionMap object</p> 
<p>Velocity Directives <br /> ● #if #elseif #else #end – conditional statement<br /> ● #foreach – list iterator<br /> ● #macro&nbsp;&nbsp; – defines Velocity macro<br /> ● #set&nbsp;&nbsp;&nbsp;&nbsp; – variable declaration<br /> ● #include – include file directly without parsing<br /> ● #parse&nbsp;&nbsp; – parse and render the specified template&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> ● #stop&nbsp;&nbsp;&nbsp;&nbsp; – stops the execution of template</p> 
<p>Core Controls&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> ● ActionButton<br /> ● ActionLink<br /> ● Button<br /> ● Checkbox<br /> ● Column<br /> ● FieldSet<br /> ● Form<br /> ● HiddenField<br /> ● ImageSubmit<br /> ● Label<br /> ● Option<br /> ● OptionGroup<br /> ● PageLink<br /> ● Panel<br /> ● PasswordField<br /> ● Radio<br /> ● RadioGroup<br /> ● Reset<br /> ● Select<br /> ● Submit<br /> ● Table<br /> ● TextArea<br /> ● TextField</p> 
<p>Extras Controls <br /> ● CayenneForm<br /> ● CheckList<br /> ● ColorPicker<br /> ● CreditCardField<br /> ● DateField<br /> ● DoubleField<br /> ● EmailField<br /> ● FieldColumn<br /> ● FormTable<br /> ● IntegerField<br /> ● LinkDecorator<br /> ● ListPanel<br /> ● LongField<br /> ● Menu<br /> ● NumberField<br /> ● PageSubmit<br /> ● PickList<br /> ● PropertySelect<br /> ● QuerySelect<br /> ● RegexField<br /> ● TabbedForm<br /> ● TabbedPanel<br /> ● TelephoneField</p> 
<p>click.xml File <br /> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br /> &lt;click-app charset=&quot;UTF-8&quot; locale=&quot;de&quot;&gt;<br /> &lt;pages package=&quot;com.mycorp.page&quot;/&gt;<br /> &lt;mode value=&quot;debug&quot;/&gt;<br /> &lt;/click-app&gt;</p> 
<p>Click App Modes <br /> ● production – caching, warn logging<br /> ● profile&nbsp;&nbsp;&nbsp;&nbsp; – caching, info logging<br /> ● development – info logging (default)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> ● debug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – debug logging<br /> ● trace&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; – trace logging</p> 
<p> </p></div></body></html>